import { request } from '../utils/axios'

// 用户相关 API 接口
export const userApi = {
  // 用户登录
  login: (data) => request.post('/api/user/login', data),

  // 用户注册
  register: (data) => request.post('/api/user/register', data),

  // 获取用户信息
  getUserInfo: () => request.post('/api/cpc/v1/user/info'),

  // 更新用户信息
  updateUserInfo: (data) => request.put('/api/user/info', data),

  // 更改密码
  changePassword: (data) => request.put('/api/user/password', data),

  // 退出登录
  logout: () => request.post('/api/user/logout')
}

// 导出默认对象
export default userApi


// 使用记录
export const getBillList = (data) => request.post('/api/cpc/v1/computer/session/hit', data)


// 变更记录
export const getBillChangeList = (data) => request.post('/api/cpc/v1/bill/list-change', data)


// 订单列表
export const getOrderList = (data) => request.post('/api/cpc/v1/order/list', data)

// 用户反馈
export const submitUserFeedback = (data) => request.post('/api/cpc/v1/user/feedback', data)




// 签到
export const checkIn = (data) => request.post('/api/cpc/v1/sign/checkin', data)

// 查询签到信息
export const getSignInfo = (data) => request.post('/api/cpc/v1/sign/info', data)


// 查询云豆套餐列表
export const getCoinPlanList = (data) => request.post('/api/cpc/v1/coin-plan/list', data)

// 查询banner列表--显示广告配置
export const getBannerList = (data) => request.post('/api/cpc/v1/banner/list', data)

// 生成充值云豆订单
export const generateCoinOrder = (data) => request.post('/api/cpc/v1/order/coin/generate', data)

// 查询订单详情
export const queryOrderDetail = (data) => request.post('/api/cpc/v1/order/detail', data)


// 支付系统下单
export const createPaymentOrder = (data) => request.post('/vpi/unifiedorder', data)


// 生成支付二维码
export const generatePaymentQRCode = (data) => request.post('/vpi/qr/generate', data)

export const checkupdates = (data) => request.post('/api/cpc/v1/client/check-for-updates', data)